package pack0626;

import java.util.Random;
import java.util.Scanner;

public class Computer {

    public String name ;

    public String[] names = {"张飞","关羽","刘备"} ;

    int score ;

    String type ;  //记录出拳的类型

    Random r = new Random()  ;

    public int showHand(){
        int n = r.nextInt(3) + 1 ;

        if(n == 1)
            type = "石头"  ;
        else if( n == 2)
            type = "剪刀" ;
        else
            type = "布" ;

        return n ;
    }

    //随机取得一个名字
    public void selectName(){
        int index = r.nextInt(names.length) ;   // 0 1 2

        this.name = names[index] ;
    }
}
